<template>
    <el-container style="height: 500px;">
        <el-header style="text-align:center; font-size: 12px">
            <el-input v-model="searchName" placeholder="请输入员工姓名或者电话" style="width: 30%;" @keyup.enter.native="searchSubmit"></el-input>
            <el-button type="primary" @click="searchSubmit">搜索</el-button>
        </el-header>
        <el-main>
            <searchInfor :searchedInforToChild="searchedInfor"></searchInfor>
        </el-main>
    </el-container>
        <!--<div id="search">
            <div class="searchbar">
                <el-input v-model="searchName" placeholder="请输入员工姓名或者电话" style="width: 30%;" @keyup.enter.native="searchSubmit"></el-input>
                <el-button type="primary" @click="searchSubmit">搜索</el-button>
            </div>
            <searchInfor :searchedInforToChild="searchedInfor"></searchInfor>
        </div>-->
</template>

<script>


 
import searchInfor from'./searchInfor'

export default {
    name:"search",
  
     data(){
      return{
        searchName:"",
        searchedInfor:[],
      }
    },
    methods:{
      searchSubmit:function(){//搜索员工功能函数
            var that=this;
			this.$axios.get("http://47.100.167.206:8082/Query/QueryHr?nameortel="+this.searchName)
            //this.$axios.get("#?nameortel="+this.searchName)
            .then(function(response){
                console.log(response);
                //searchedInfor=this.response;
                that.searchedInfor=response.data;
            },function(err){
                alert("搜索员工失败")
            }
            )
			console.log(this.searchName);
		 },
    },
    components:{searchInfor},
}
</script>

<style >

</style>
